package cn.com.blueInfo.bpm.system.convert;

import cn.com.blueInfo.bpm.common.convert.BaseConvert;
import cn.com.blueInfo.bpm.system.entity.Dict;
import cn.com.blueInfo.bpm.system.request.DictDTO;
import cn.com.blueInfo.bpm.system.response.DictVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 枚举表 对象转换
 * @author suxch
 * @since 2025-08-31 16:20:56
 */
@Mapper(componentModel = "spring")
public interface DictConvert
        extends BaseConvert<Dict, DictDTO, DictVO> {

    Dict dtoToEntity(DictDTO dto);

    Dict dtoToEntity(DictDTO.UpdatePartialDTO dto);

    @Mapping(source = "status", target = "status", qualifiedByName = "enumToDesc")
    @Mapping(source = "deleted", target = "deleted", qualifiedByName = "enumToDesc")
    @Mapping(source = "dictType", target = "dictType", qualifiedByName = "enumToDesc")
    DictVO entityToVO(Dict entity);

}